import React, { Suspense } from "react";
import ReactDOM from "react-dom/client";
import App from "./App";
import "./index.css";
import store from "./store/index";
import { Provider } from "react-redux";
import { RouterProvider } from "react-router-dom";

//新增
import { PersistGate } from "redux-persist/integration/react";

//新增
import { persistStore } from "redux-persist";

//新增
const persistor = persistStore(store);

import router from "./router/index";

ReactDOM.createRoot(document.getElementById("root")).render(
  <React.StrictMode>
    <Provider store={store}>
      <Suspense fallback={<div>正在加载中。。。</div>}>
        <RouterProvider router={router}></RouterProvider>
      </Suspense>
    </Provider>
  </React.StrictMode>
);
